package com.carvajal.adminpos.models;

import java.util.Date;

import com.carvajal.adminpos.models.User.UserEntry;
import com.carvajal.adminpos.utils.Constants;

import android.provider.BaseColumns;

public class Purchase {

	private String identificacion;
	private String fecha;
	private String articulo;
	private Integer cantidad;
	private String usuario;

	/**
	 * @return the identificacion
	 */
	public String getIdentificacion() {
		return identificacion;
	}

	/**
	 * @param identificacion
	 *            the identificacion to set
	 */
	public void setIdentificacion(String identificacion) {
		this.identificacion = identificacion;
	}

	/**
	 * @return the articulo
	 */
	public String getArticulo() {
		return articulo;
	}

	/**
	 * @param articulo
	 *            the articulo to set
	 */
	public void setArticulo(String articulo) {
		this.articulo = articulo;
	}

	/**
	 * @return the cantidad
	 */
	public Integer getCantidad() {
		return cantidad;
	}

	/**
	 * @param cantidad
	 *            the cantidad to set
	 */
	public void setCantidad(Integer cantidad) {
		this.cantidad = cantidad;
	}

	/**
	 * @return the usuario
	 */
	public String getUsuario() {
		return usuario;
	}

	/**
	 * @param usuario
	 *            the usuario to set
	 */
	public void setUsuario(String usuario) {
		this.usuario = usuario;
	}

	public String getFecha() {
		return fecha;
	}

	public void setFecha(String fecha) {
		this.fecha = fecha;
	}

	public static abstract class PurchaseEntry implements BaseColumns {

		public static final String TABLE_NAME 					= "Purchase";
		public static final String COLUMN_NAME_IDENTIFICATION 	= "identification";
		public static final String COLUMN_NAME_DATE				= "date";
		public static final String COLUMN_NAME_ARTICLE 			= "article";
		public static final String COLUMN_NAME_QUANTITY 		= "quantity";
		public static final String COLUMN_NAME_USER 			= "user";
	}
	
	 public static final String SQL_CREATE_ENTRIES_PURCHASE = "CREATE TABLE " + PurchaseEntry.TABLE_NAME + " (" +
			 	PurchaseEntry.COLUMN_NAME_IDENTIFICATION    + Constants.VARCHAR_TYPE_PRIMARY_KEY  + Constants.COMMA_SEP +
	            PurchaseEntry.COLUMN_NAME_DATE     + Constants.VARCHAR_TYPE              + Constants.COMMA_SEP +
	            PurchaseEntry.COLUMN_NAME_ARTICLE         + Constants.VARCHAR_TYPE              + Constants.COMMA_SEP +
	            PurchaseEntry.COLUMN_NAME_QUANTITY    +  Constants.INTEGER_TYPE + " DEFAULT 0"    + Constants.COMMA_SEP +
	            PurchaseEntry.COLUMN_NAME_USER     + Constants.VARCHAR_TYPE     +
	           " );";
	 
	 public static final String SQL_DELETE_ENTRIES_PURCHASE = "DROP TABLE IF EXISTS " + PurchaseEntry.TABLE_NAME+" ;";

}
